package com.example.xinhuaxin.controller;

import com.example.xinhuaxin.entity.Point;
import com.example.xinhuaxin.service.impl.PointServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @description:
 * @author: YancyZhang
 * @time: 2022/6/13 10:47
 */

@Controller
public class PointController {
    @Autowired
    private PointServiceImpl pointService;

    @RequestMapping("/getPointInfo")
    public String getPointInfo(HttpServletRequest req, Model model){
        String user_id = req.getParameter("user_id");
        Point p = pointService.getPointInfo(user_id);
        System.out.println(p);
        model.addAttribute("point_info", p);
        return "point";
    }
}